/*
 * Particle.h
 *
 *  Created on: 14/11/2011
 *      Author: will
 */

#ifndef PARTICLE_H_
#define PARTICLE_H_

#include "GraphEdge.h"
#include "mex.h"

class Particle {
public:
	Particle();
	virtual ~Particle();
	Particle(const Particle & other);
	Particle & operator=(const Particle & other);

	// Location
	GraphEdge* root;
	double fraction;
	bool direction;

	// Likelihood
	double odoLikelihood;
	double visLikelihood;
	double weight;
	double hypothesis;

	Particle(GraphEdge* root, double fraction, bool direction);

	// Serialization
	friend class boost::serialization::access;
	template<class Archive>
	void serialize(Archive &ar, const unsigned int version) {

		mexPrintf("SERIALIZATION: Processing Particle\n");

		ar & BOOST_SERIALIZATION_NVP(root);
		ar & BOOST_SERIALIZATION_NVP(fraction);
		ar & BOOST_SERIALIZATION_NVP(direction);
		//ar & BOOST_SERIALIZATION_NVP(odoLikelihood);
		//ar & BOOST_SERIALIZATION_NVP(visLikelihood);
		ar & BOOST_SERIALIZATION_NVP(weight);
		//ar & BOOST_SERIALIZATION_NVP(hypothesis);
	}
};

#endif /* PARTICLE_H_ */
